from django import template  
register = template.Library()  

def showcolor(value, h): # Only one argument.  
    value = float(value)
    flag = 0
    if h < 0:
        h = -h
        flag = 1
    if value < h:
        return  flag and "goodtag" or "badtag"
    else:
        return  flag and "badtag"  or "goodtag"

register.filter(showcolor) 
